using System;
using System.Collections.Generic;
using System.Linq;

namespace MT5Trade.Models
{
    /// <summary>
    /// 对冲策略枚举
    /// </summary>
    public enum HedgeStrategy
    {
        /// <summary>
        /// 保守策略：高对冲比例，低风险
        /// </summary>
        Conservative,
        /// <summary>
        /// 平衡策略：中等对冲比例，平衡风险收益
        /// </summary>
        Balanced,
        /// <summary>
        /// 激进策略：低对冲比例，追求收益
        /// </summary>
        Aggressive,
        /// <summary>
        /// 自适应策略：根据市场条件动态调整
        /// </summary>
        Adaptive
    }

    /// <summary>
    /// 对冲建议类型
    /// </summary>
    public enum HedgeAdvice
    {
        /// <summary>
        /// 强烈建议对冲
        /// </summary>
        StrongHedge,
        /// <summary>
        /// 建议对冲
        /// </summary>
        Hedge,
        /// <summary>
        /// 中性，可选择性对冲
        /// </summary>
        Neutral,
        /// <summary>
        /// 不建议对冲
        /// </summary>
        NoHedge,
        /// <summary>
        /// 强烈不建议对冲
        /// </summary>
        StrongNoHedge
    }

    /// <summary>
    /// 对冲结果数据结构
    /// </summary>
    public class HedgeRatioResult
    {
        /// <summary>
        /// 推荐对冲比例（0-1）
        /// </summary>
        public double RecommendedRatio { get; set; }

        /// <summary>
        /// 最小对冲比例
        /// </summary>
        public double MinRatio { get; set; }

        /// <summary>
        /// 最大对冲比例
        /// </summary>
        public double MaxRatio { get; set; }

        /// <summary>
        /// 对冲建议
        /// </summary>
        public HedgeAdvice Advice { get; set; }

        /// <summary>
        /// 风险等级（1-5，5为最高风险）
        /// </summary>
        public int RiskLevel { get; set; }

        /// <summary>
        /// 预期对冲成功率
        /// </summary>
        public double SuccessProbability { get; set; }

        /// <summary>
        /// 预期风险降低度
        /// </summary>
        public double RiskReduction { get; set; }

        /// <summary>
        /// 对冲成本估算
        /// </summary>
        public double HedgeCost { get; set; }

        /// <summary>
        /// 置信度
        /// </summary>
        public double Confidence { get; set; }

        /// <summary>
        /// 详细分析说明
        /// </summary>
        public string Analysis { get; set; }

        /// <summary>
        /// 风险预警信息
        /// </summary>
        public List<string> Warnings { get; set; } = new List<string>();
    }

    /// <summary>
    /// 市场流动性信息
    /// </summary>
    public class MarketLiquidity
    {
        /// <summary>
        /// 买卖价差
        /// </summary>
        public double BidAskSpread { get; set; }

        /// <summary>
        /// 市场深度
        /// </summary>
        public double MarketDepth { get; set; }

        /// <summary>
        /// 流动性评分（0-1，1为最佳）
        /// </summary>
        public double LiquidityScore { get; set; }

        /// <summary>
        /// 交易成本估算
        /// </summary>
        public double TradingCost { get; set; }
    }

    /// <summary>
    /// 对冲效果评估
    /// </summary>
    public class HedgeEffectiveness
    {
        /// <summary>
        /// 历史成功率
        /// </summary>
        public double HistoricalSuccessRate { get; set; }

        /// <summary>
        /// 平均风险降低度
        /// </summary>
        public double AverageRiskReduction { get; set; }

        /// <summary>
        /// 平均对冲成本
        /// </summary>
        public double AverageCost { get; set; }

        /// <summary>
        /// 风险调整收益
        /// </summary>
        public double RiskAdjustedReturn { get; set; }

        /// <summary>
        /// 对冲效率评分
        /// </summary>
        public double EfficiencyScore { get; set; }
    }

    /// <summary>
    /// 基于缺口类型的对冲比例计算器
    /// 实现智能对冲策略，根据缺口类型、市场条件动态调整对冲比例
    /// </summary>
    public class HedgeRatioCalculator
    {
        #region 私有字段

        /// <summary>
        /// 缺口分析器
        /// </summary>
        private readonly GapAnalyzer _gapAnalyzer;

        /// <summary>
        /// 对冲策略
        /// </summary>
        private HedgeStrategy _strategy;

        /// <summary>
        /// 历史对冲记录
        /// </summary>
        private readonly List<HedgeRecord> _hedgeHistory;

        // 对冲比例基础参数
        private const double COMMON_GAP_BASE_RATIO = 0.90;      // 普通缺口基础对冲比例
        private const double BREAKAWAY_GAP_BASE_RATIO = 0.30;   // 突破缺口基础对冲比例
        private const double RUNAWAY_GAP_BASE_RATIO = 0.20;     // 持续缺口基础对冲比例
        private const double EXHAUSTION_GAP_BASE_RATIO = 0.85;  // 衰竭缺口基础对冲比例

        // 风险调整参数
        private const double VOLATILITY_ADJUSTMENT_FACTOR = 0.5;    // 波动率调整因子
        private const double LIQUIDITY_ADJUSTMENT_FACTOR = 0.3;     // 流动性调整因子
        private const double SIZE_ADJUSTMENT_FACTOR = 0.2;          // 缺口大小调整因子

        #endregion

        #region 构造函数

        /// <summary>
        /// 构造函数
        /// </summary>
        /// <param name="gapAnalyzer">缺口分析器</param>
        /// <param name="strategy">对冲策略</param>
        public HedgeRatioCalculator(GapAnalyzer gapAnalyzer, HedgeStrategy strategy = HedgeStrategy.Adaptive)
        {
            _gapAnalyzer = gapAnalyzer ?? throw new ArgumentNullException(nameof(gapAnalyzer));
            _strategy = strategy;
            _hedgeHistory = new List<HedgeRecord>();
        }

        #endregion

        #region 公共方法

        /// <summary>
        /// 计算基于缺口类型的对冲比例
        /// </summary>
        /// <param name="gapData">缺口数据</param>
        /// <param name="marketData">市场数据</param>
        /// <param name="liquidity">市场流动性信息</param>
        /// <returns>对冲比例结果</returns>
        public HedgeRatioResult CalculateHedgeRatio(GapData gapData, List<MarketDataPoint> marketData, MarketLiquidity liquidity = null)
        {
            if (gapData == null)
                throw new ArgumentNullException(nameof(gapData));

            var result = new HedgeRatioResult();

            try
            {
                // 1. 获取基础对冲比例
                var baseRatio = GetBaseHedgeRatio(gapData.Type);

                // 2. 根据缺口大小调整
                var sizeAdjustment = CalculateSizeAdjustment(gapData);

                // 3. 根据市场波动率调整
                var volatilityAdjustment = CalculateVolatilityAdjustment(marketData);

                // 4. 根据流动性调整
                var liquidityAdjustment = CalculateLiquidityAdjustment(liquidity);

                // 5. 根据策略调整
                var strategyAdjustment = GetStrategyAdjustment(_strategy);

                // 6. 计算最终对冲比例
                var finalRatio = baseRatio * sizeAdjustment * volatilityAdjustment * liquidityAdjustment * strategyAdjustment;
                
                // 确保对冲比例在合理范围内
                result.RecommendedRatio = Math.Max(0.0, Math.Min(1.0, finalRatio));
                result.MinRatio = Math.Max(0.0, result.RecommendedRatio - 0.15);
                result.MaxRatio = Math.Min(1.0, result.RecommendedRatio + 0.15);

                // 7. 评估对冲建议
                result.Advice = GetHedgeAdvice(result.RecommendedRatio, gapData);

                // 8. 计算风险等级
                result.RiskLevel = CalculateRiskLevel(gapData, result.RecommendedRatio);

                // 9. 预测成功率和风险降低度
                result.SuccessProbability = EstimateSuccessProbability(gapData, result.RecommendedRatio);
                result.RiskReduction = EstimateRiskReduction(gapData, result.RecommendedRatio);

                // 10. 估算对冲成本
                result.HedgeCost = EstimateHedgeCost(result.RecommendedRatio, liquidity);

                // 11. 计算置信度
                result.Confidence = CalculateConfidence(gapData, marketData);

                // 12. 生成分析说明
                result.Analysis = GenerateAnalysis(gapData, result);

                // 13. 生成风险预警
                result.Warnings = GenerateWarnings(gapData, result, liquidity);

                return result;
            }
            catch (Exception ex)
            {
                // 发生异常时返回保守的对冲建议
                return new HedgeRatioResult
                {
                    RecommendedRatio = 0.50,
                    MinRatio = 0.35,
                    MaxRatio = 0.65,
                    Advice = HedgeAdvice.Neutral,
                    RiskLevel = 3,
                    SuccessProbability = 0.60,
                    RiskReduction = 0.40,
                    HedgeCost = 0.05,
                    Confidence = 0.50,
                    Analysis = $"计算过程发生异常，返回保守建议: {ex.Message}",
                    Warnings = new List<string> { "对冲比例计算异常，建议人工审核" }
                };
            }
        }

        /// <summary>
        /// 批量计算多个缺口的对冲比例
        /// </summary>
        /// <param name="gaps">缺口列表</param>
        /// <param name="marketData">市场数据</param>
        /// <param name="liquidity">市场流动性</param>
        /// <returns>对冲比例结果列表</returns>
        public List<HedgeRatioResult> CalculateBatchHedgeRatios(List<GapData> gaps, List<MarketDataPoint> marketData, MarketLiquidity liquidity = null)
        {
            var results = new List<HedgeRatioResult>();

            foreach (var gap in gaps)
            {
                var result = CalculateHedgeRatio(gap, marketData, liquidity);
                results.Add(result);
            }

            return results;
        }

        /// <summary>
        /// 评估对冲效果
        /// </summary>
        /// <param name="gapType">缺口类型</param>
        /// <returns>对冲效果评估</returns>
        public HedgeEffectiveness EvaluateHedgeEffectiveness(GapType gapType)
        {
            var typeHistory = _hedgeHistory.Where(h => h.GapType == gapType).ToList();
            
            if (!typeHistory.Any())
            {
                return new HedgeEffectiveness
                {
                    HistoricalSuccessRate = GetBaseSuccessRate(gapType),
                    AverageRiskReduction = GetBaseRiskReduction(gapType),
                    AverageCost = 0.03,
                    RiskAdjustedReturn = 0.0,
                    EfficiencyScore = 0.60
                };
            }

            return new HedgeEffectiveness
            {
                HistoricalSuccessRate = typeHistory.Count(h => h.IsSuccessful) / (double)typeHistory.Count,
                AverageRiskReduction = typeHistory.Average(h => h.RiskReduction),
                AverageCost = typeHistory.Average(h => h.Cost),
                RiskAdjustedReturn = typeHistory.Average(h => h.RiskAdjustedReturn),
                EfficiencyScore = CalculateEfficiencyScore(typeHistory)
            };
        }

        /// <summary>
        /// 更新对冲策略
        /// </summary>
        /// <param name="strategy">新策略</param>
        public void UpdateStrategy(HedgeStrategy strategy)
        {
            _strategy = strategy;
        }

        /// <summary>
        /// 记录对冲结果
        /// </summary>
        /// <param name="record">对冲记录</param>
        public void RecordHedgeResult(HedgeRecord record)
        {
            if (record != null)
            {
                _hedgeHistory.Add(record);
                
                // 保持历史记录数量在合理范围内
                if (_hedgeHistory.Count > 1000)
                {
                    _hedgeHistory.RemoveAt(0);
                }
            }
        }

        /// <summary>
        /// 获取对冲策略统计
        /// </summary>
        /// <returns>策略统计信息</returns>
        public Dictionary<string, object> GetHedgeStatistics()
        {
            var stats = new Dictionary<string, object>();

            if (_hedgeHistory.Any())
            {
                stats["TotalHedges"] = _hedgeHistory.Count;
                stats["SuccessRate"] = _hedgeHistory.Count(h => h.IsSuccessful) / (double)_hedgeHistory.Count;
                stats["AverageRiskReduction"] = _hedgeHistory.Average(h => h.RiskReduction);
                stats["AverageCost"] = _hedgeHistory.Average(h => h.Cost);
                
                // 按缺口类型统计
                foreach (GapType gapType in Enum.GetValues(typeof(GapType)))
                {
                    var typeHedges = _hedgeHistory.Where(h => h.GapType == gapType).ToList();
                    if (typeHedges.Any())
                    {
                        stats[$"{gapType}_Count"] = typeHedges.Count;
                        stats[$"{gapType}_SuccessRate"] = typeHedges.Count(h => h.IsSuccessful) / (double)typeHedges.Count;
                        stats[$"{gapType}_AvgRiskReduction"] = typeHedges.Average(h => h.RiskReduction);
                    }
                }
            }
            else
            {
                stats["TotalHedges"] = 0;
                stats["Message"] = "暂无历史对冲数据";
            }

            return stats;
        }

        #endregion

        #region 私有方法

        /// <summary>
        /// 获取基础对冲比例
        /// </summary>
        /// <param name="gapType">缺口类型</param>
        /// <returns>基础对冲比例</returns>
        private double GetBaseHedgeRatio(GapType gapType)
        {
            return gapType switch
            {
                GapType.Common => COMMON_GAP_BASE_RATIO,        // 普通缺口：高对冲，因填补概率高
                GapType.Breakaway => BREAKAWAY_GAP_BASE_RATIO,  // 突破缺口：低对冲，趋势可能持续
                GapType.Runaway => RUNAWAY_GAP_BASE_RATIO,      // 持续缺口：最低对冲，趋势强劲
                GapType.Exhaustion => EXHAUSTION_GAP_BASE_RATIO, // 衰竭缺口：高对冲，趋势可能反转
                _ => 0.50 // 默认中等对冲比例
            };
        }

        /// <summary>
        /// 计算缺口大小调整系数
        /// </summary>
        /// <param name="gapData">缺口数据</param>
        /// <returns>调整系数</returns>
        private double CalculateSizeAdjustment(GapData gapData)
        {
            var absGapPercentage = Math.Abs(gapData.GapPercentage);
            
            // 大缺口降低对冲比例（趋势可能更强），小缺口提高对冲比例（更容易填补）
            if (absGapPercentage > 5.0)
                return 0.70;  // 特大缺口
            else if (absGapPercentage > 2.0)
                return 0.85;  // 大缺口
            else if (absGapPercentage > 0.5)
                return 1.00;  // 中等缺口
            else
                return 1.15;  // 小缺口
        }

        /// <summary>
        /// 计算波动率调整系数
        /// </summary>
        /// <param name="marketData">市场数据</param>
        /// <returns>调整系数</returns>
        private double CalculateVolatilityAdjustment(List<MarketDataPoint> marketData)
        {
            if (marketData == null || marketData.Count < 2)
                return 1.0;

            // 计算近期波动率
            var returns = new List<double>();
            for (int i = 1; i < Math.Min(marketData.Count, 20); i++)
            {
                var ret = Math.Log(marketData[i].Close / marketData[i - 1].Close);
                returns.Add(ret);
            }

            if (!returns.Any()) return 1.0;

            var volatility = Math.Sqrt(returns.Select(r => r * r).Average()) * Math.Sqrt(252) * 100;

            // 高波动率环境下提高对冲比例
            if (volatility > 30.0)
                return 1.20;  // 极高波动率
            else if (volatility > 20.0)
                return 1.10;  // 高波动率
            else if (volatility > 10.0)
                return 1.00;  // 正常波动率
            else
                return 0.90;  // 低波动率
        }

        /// <summary>
        /// 计算流动性调整系数
        /// </summary>
        /// <param name="liquidity">流动性信息</param>
        /// <returns>调整系数</returns>
        private double CalculateLiquidityAdjustment(MarketLiquidity liquidity)
        {
            if (liquidity == null) return 1.0;

            var liquidityScore = liquidity.LiquidityScore;

            // 流动性越好，对冲越容易执行，可以适当提高对冲比例
            if (liquidityScore > 0.8)
                return 1.05;  // 高流动性
            else if (liquidityScore > 0.6)
                return 1.00;  // 正常流动性
            else if (liquidityScore > 0.4)
                return 0.95;  // 低流动性
            else
                return 0.85;  // 极低流动性
        }

        /// <summary>
        /// 获取策略调整系数
        /// </summary>
        /// <param name="strategy">对冲策略</param>
        /// <returns>调整系数</returns>
        private double GetStrategyAdjustment(HedgeStrategy strategy)
        {
            return strategy switch
            {
                HedgeStrategy.Conservative => 1.15,  // 保守策略提高对冲比例
                HedgeStrategy.Balanced => 1.00,     // 平衡策略保持原比例
                HedgeStrategy.Aggressive => 0.80,   // 激进策略降低对冲比例
                HedgeStrategy.Adaptive => 1.00,     // 自适应策略动态调整
                _ => 1.00
            };
        }

        /// <summary>
        /// 获取对冲建议
        /// </summary>
        /// <param name="hedgeRatio">对冲比例</param>
        /// <param name="gapData">缺口数据</param>
        /// <returns>对冲建议</returns>
        private HedgeAdvice GetHedgeAdvice(double hedgeRatio, GapData gapData)
        {
            if (hedgeRatio > 0.80)
                return HedgeAdvice.StrongHedge;
            else if (hedgeRatio > 0.60)
                return HedgeAdvice.Hedge;
            else if (hedgeRatio > 0.40)
                return HedgeAdvice.Neutral;
            else if (hedgeRatio > 0.20)
                return HedgeAdvice.NoHedge;
            else
                return HedgeAdvice.StrongNoHedge;
        }

        /// <summary>
        /// 计算风险等级
        /// </summary>
        /// <param name="gapData">缺口数据</param>
        /// <param name="hedgeRatio">对冲比例</param>
        /// <returns>风险等级（1-5）</returns>
        private int CalculateRiskLevel(GapData gapData, double hedgeRatio)
        {
            var baseRisk = gapData.Type switch
            {
                GapType.Common => 2,      // 普通缺口风险较低
                GapType.Breakaway => 4,   // 突破缺口风险较高
                GapType.Runaway => 5,     // 持续缺口风险最高
                GapType.Exhaustion => 3,  // 衰竭缺口风险中等
                _ => 3
            };

            // 根据对冲比例调整风险等级
            if (hedgeRatio > 0.80)
                baseRisk = Math.Max(1, baseRisk - 2);  // 高对冲降低风险
            else if (hedgeRatio < 0.30)
                baseRisk = Math.Min(5, baseRisk + 1);  // 低对冲增加风险

            return Math.Max(1, Math.Min(5, baseRisk));
        }

        /// <summary>
        /// 估算对冲成功率
        /// </summary>
        /// <param name="gapData">缺口数据</param>
        /// <param name="hedgeRatio">对冲比例</param>
        /// <returns>预期成功率</returns>
        private double EstimateSuccessProbability(GapData gapData, double hedgeRatio)
        {
            var baseSuccessRate = GetBaseSuccessRate(gapData.Type);
            
            // 对冲比例越高，成功率越高（但边际效应递减）
            var hedgeBonus = Math.Sqrt(hedgeRatio) * 0.2;
            
            return Math.Min(0.95, baseSuccessRate + hedgeBonus);
        }

        /// <summary>
        /// 估算风险降低度
        /// </summary>
        /// <param name="gapData">缺口数据</param>
        /// <param name="hedgeRatio">对冲比例</param>
        /// <returns>风险降低度</returns>
        private double EstimateRiskReduction(GapData gapData, double hedgeRatio)
        {
            var baseRiskReduction = GetBaseRiskReduction(gapData.Type);
            
            // 风险降低度与对冲比例成正比
            return Math.Min(0.90, baseRiskReduction * hedgeRatio * 1.2);
        }

        /// <summary>
        /// 估算对冲成本
        /// </summary>
        /// <param name="hedgeRatio">对冲比例</param>
        /// <param name="liquidity">流动性信息</param>
        /// <returns>对冲成本</returns>
        private double EstimateHedgeCost(double hedgeRatio, MarketLiquidity liquidity)
        {
            var baseCost = 0.02; // 基础成本2%
            
            if (liquidity != null)
            {
                baseCost += liquidity.TradingCost;
            }
            
            // 对冲比例越高，成本越高
            return baseCost * (0.5 + hedgeRatio * 0.5);
        }

        /// <summary>
        /// 计算置信度
        /// </summary>
        /// <param name="gapData">缺口数据</param>
        /// <param name="marketData">市场数据</param>
        /// <returns>置信度</returns>
        private double CalculateConfidence(GapData gapData, List<MarketDataPoint> marketData)
        {
            var confidence = gapData.Confidence;
            
            // 根据市场数据质量调整置信度
            if (marketData != null && marketData.Count > 50)
            {
                confidence += 0.1;
            }
            
            return Math.Min(0.95, confidence);
        }

        /// <summary>
        /// 生成分析说明
        /// </summary>
        /// <param name="gapData">缺口数据</param>
        /// <param name="result">对冲结果</param>
        /// <returns>分析说明</returns>
        private string GenerateAnalysis(GapData gapData, HedgeRatioResult result)
        {
            var analysis = $"【{gapData.Type}缺口分析】\n";
            analysis += $"缺口大小: {Math.Abs(gapData.GapPercentage):P2}, ";
            analysis += $"填补概率: {gapData.FillProbability:P2}\n";
            analysis += $"推荐对冲比例: {result.RecommendedRatio:P2}, ";
            analysis += $"预期成功率: {result.SuccessProbability:P2}\n";
            analysis += $"风险等级: {result.RiskLevel}/5, ";
            analysis += $"预期风险降低: {result.RiskReduction:P2}";
            
            return analysis;
        }

        /// <summary>
        /// 生成风险预警
        /// </summary>
        /// <param name="gapData">缺口数据</param>
        /// <param name="result">对冲结果</param>
        /// <param name="liquidity">流动性信息</param>
        /// <returns>预警列表</returns>
        private List<string> GenerateWarnings(GapData gapData, HedgeRatioResult result, MarketLiquidity liquidity)
        {
            var warnings = new List<string>();

            if (Math.Abs(gapData.GapPercentage) > 5.0)
            {
                warnings.Add("⚠️ 特大缺口，市场可能出现剧烈波动");
            }

            if (result.RiskLevel >= 4)
            {
                warnings.Add("⚠️ 高风险等级，建议谨慎操作");
            }

            if (result.HedgeCost > 0.05)
            {
                warnings.Add("⚠️ 对冲成本较高，可能影响收益");
            }

            if (liquidity != null && liquidity.LiquidityScore < 0.5)
            {
                warnings.Add("⚠️ 市场流动性不足，对冲执行可能困难");
            }

            if (result.Confidence < 0.6)
            {
                warnings.Add("⚠️ 分析置信度较低，建议补充更多数据");
            }

            return warnings;
        }

        /// <summary>
        /// 获取基础成功率
        /// </summary>
        /// <param name="gapType">缺口类型</param>
        /// <returns>基础成功率</returns>
        private double GetBaseSuccessRate(GapType gapType)
        {
            return gapType switch
            {
                GapType.Common => 0.85,
                GapType.Breakaway => 0.65,
                GapType.Runaway => 0.60,
                GapType.Exhaustion => 0.80,
                _ => 0.70
            };
        }

        /// <summary>
        /// 获取基础风险降低度
        /// </summary>
        /// <param name="gapType">缺口类型</param>
        /// <returns>基础风险降低度</returns>
        private double GetBaseRiskReduction(GapType gapType)
        {
            return gapType switch
            {
                GapType.Common => 0.70,
                GapType.Breakaway => 0.50,
                GapType.Runaway => 0.45,
                GapType.Exhaustion => 0.65,
                _ => 0.60
            };
        }

        /// <summary>
        /// 计算效率评分
        /// </summary>
        /// <param name="records">对冲记录</param>
        /// <returns>效率评分</returns>
        private double CalculateEfficiencyScore(List<HedgeRecord> records)
        {
            if (!records.Any()) return 0.60;

            var successRate = records.Count(r => r.IsSuccessful) / (double)records.Count;
            var avgRiskReduction = records.Average(r => r.RiskReduction);
            var avgCost = records.Average(r => r.Cost);

            // 综合评分：成功率 * 风险降低度 / 成本
            return (successRate * avgRiskReduction) / Math.Max(0.01, avgCost);
        }

        #endregion
    }

    /// <summary>
    /// 对冲记录
    /// </summary>
    public class HedgeRecord
    {
        /// <summary>
        /// 记录时间
        /// </summary>
        public DateTime Time { get; set; }

        /// <summary>
        /// 缺口类型
        /// </summary>
        public GapType GapType { get; set; }

        /// <summary>
        /// 对冲比例
        /// </summary>
        public double HedgeRatio { get; set; }

        /// <summary>
        /// 是否成功
        /// </summary>
        public bool IsSuccessful { get; set; }

        /// <summary>
        /// 风险降低度
        /// </summary>
        public double RiskReduction { get; set; }

        /// <summary>
        /// 实际成本
        /// </summary>
        public double Cost { get; set; }

        /// <summary>
        /// 风险调整收益
        /// </summary>
        public double RiskAdjustedReturn { get; set; }

        /// <summary>
        /// 备注
        /// </summary>
        public string Notes { get; set; }
    }
}


